package com.web.dao.impl;

import com.web.dao.CourseDAO;
import com.web.entity.Course;
import com.web.entity.Student;
import com.web.util.JDBCUtils;

import java.util.List;

public class CourseDAOImpl implements CourseDAO {
    @Override
    public List<Course> selectAllCourses() {
        return JDBCUtils.query(Course.class,"select * from course");
    }

    @Override
    public List<Course> selectCoursePage(int start, int len) {
        return JDBCUtils.query(Course.class,
                "select * from course limit ?,?",start,len);
    }

    @Override
    public int selectCourseCount() {
        return JDBCUtils.queryCount("select count(*) from course");
    }
}
